<template>
 <el-config-provider :locale="locale">
     <el-backtop :right="100" :bottom="100" :visibility-height="100" target=".el-main" />
     <div class="domesty">
    <el-pagination
      v-model:current-page="pages"
      v-model:page-size="limits"
      :page-sizes="[10,50,100, 200, 300, 400]"
      :small="small"
      :disabled="disabled"
      :background="background"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
  </el-config-provider>
 
</template>
<script> 
  import { ElConfigProvider } from 'element-plus'
  import zhCn from 'element-plus/lib/locale/lang/zh-cn'
export default {
    components:{
        ElConfigProvider
    },
    setup(){
        return{
            locale:zhCn
        }
    },
  data() {
    return {
      limits: this.limit,
      pages: this.page,
    };
  },
  props: {
    limit: Number,
    page: Number,
    total: Number,
  },
  methods: {
    handleSizeChange(val) {
      //新每页条数
      this.$emit("limits", val);
      console.log(val);
    },
    handleCurrentChange(val) {
      //新当前页
      this.$emit("pages", val);
      console.log(val);
    },
  },
};
</script>
<style lang="less" scoped>
.domesty {
  margin-top: 20px;
}
</style>